#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time    : 2020/11/1 11:58
# @Author  : LJ
# @Site    : 
# @File    : 第三周_第一节.py
# @Software: PyCharm

# 斐波那契函数
def fei_bo(n):
    a = 1
    b = 0
    for i in range(1,n):
        c = a + b
        a, b = b, c
    return c

print(fei_bo(10))

def fei_bo1(n):
    a = 1
    b = 0
    i = 0
    while i < n:
        a, b = b, a + b
        i += 1
    return a
print(fei_bo1(10))

class ParamsTypeError(Exception):
    pass


def test(x,y):
    try:
        if isinstance(x, int) and isinstance(y,int):
            return x + y
        elif isinstance(x, str) and isinstance(y, str):
            return int(x)+int(y)
    except Exception as e:
        print(e)
    else:
        raise ParamsTypeError("无法处理")





print(test([1,2],[2,3]))